home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
objeas1a.zip
/
OBJECT.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-04
|
13KB
|
737 lines
#include <dos.h>
#include <string.h>
#include <graphics.h>
#define TRUE 1
#define FALSE 0
#define IN 0
#define OUT 1
#define THICK 0
#define THIN 1
#define TEXT 0
#define IMAGE 1
#define ALTA 30
#define ALTB 48
#define ALTC 46
#define ALTD 32
#define ALTE 18
#define ALTF 33
#define ALTG 34
#define ALTH 35
#define ALTI 23
#define ALTJ 36
#define ALTK 37
#define ALTL 38
#define ALTM 50
#define ALTN 49
#define ALTO 24
#define ALTP 25
#define ALTQ 16
#define ALTR 19
#define ALTS 31
#define ALTT 20
#define ALTU 22
#define ALTV 47
#define ALTW 17
#define ALTX 45
#define ALTY 21
#define ALTZ 44
#define ALT1 120
#define ALT2 121
#define ALT3 122
#define ALT4 123
#define ALT5 124
#define ALT6 125
#define ALT7 126
#define ALT8 127
#define ALT9 128
#define ALT0 129
#define ALTMINUS 130
#define ALTPLUS 131
//LIB
void vprintat(int cols,int rows,int fore,int back,char *,...);
void vprintc(int row,int fore,int back,char *,...);
void printat(int,int,int,int,char *);
void printc(int,int,int,char *);
void cprintat(int,int,int,int,char *,...);
void cprintc(int,int,int,char *,...);
void clear(char ch,int fore,int back);
void cursoroff();
void cursoron();
void settext(int,int);
void chsattr(int,int);
void chcattr(int,int,int,int,int);
void dlay(int ticks);
long getticks();
int altkey();
int ctrlkey();
int lshiftkey();
int rshiftkey();
void flushkeys();
unsigned char getvidmode();
//MOUSECLASS
class Mcursor {
int shown;
int current;
int xpos;
int ypos;
void mouse_interrupt();
int m1;
int m2;
int m3;
int m4;
int button;
int count;
long tickcount;
int disabled;
public:
int init();
void changeto(int);
void get_status();
void show();
void hide();
void set_hor_bounds(int,int);
void set_ver_bounds(int,int);
void Mcursor::conditional_off(int x1,int y1,int x2,int y2);
void Mcursor::position(int,int);
int LBP();
int RBP();
int getcurrent();
int mousex();
int mousey();
int mx();
int my();
void unarm();
void arm();
int LBDCLK();
};
#define UPARROW 1
#define DOT 2
#define PENCIL 3
#define CROSSHAIR 4
#define ARROW 5
#define FINGER 6
#define POINT 7
#define CLOCK 8
#define DISK 9
#define IBAR 10
#define PAINTCAN 11
#define HAND 12
#define ERASOR 13
#define GUNSIGHT 14
#define SCISSORS 15
#define JAWS 16
//WINDOW
typedef unsigned char screenbuff[4000];
typedef char itemarray[24][80];
#define SINGLE 0
#define DOUBLE 1
#define HOR 0
#define VER 1
class Twindow{
protected:
int x;
int y;
int x1;
int y1;
int fgd;
int bgd;
int shad;
int shadcolor;
int size;
char id[15];
int existtitle;
int bordertype;
int shown;
screenbuff *save;
public:
Twindow();
~Twindow();
void getstyle();
void init(int xpos,int ypos,int x1pos,int y1pos,
int fore,int back,int shadow,int shadowcolor);
void border();
void setborder(int style);
int getborder();
void cfgd(int fore);
void cbgd(int back);
int getfgd();
int getbgd();
void fill();
void divider(int direction,int style,int offset);
void show();
void zoom();
void hide();
void elim();
void title(char txt[15]);
int istitle();
int isshown();
int isx();
int isy();
int isx1();
int isy1();
int issize();
void wprintat(int,int,int,int,char*);
void wprintc(int,int,int,char*);
};
class Tmenu:public Twindow{
protected:
int itemcount;
itemarray items;
int hifore;
int hiback;
int menuchoice;
public:
void init(int itemcnt,itemarray item,int xpos,int ypos,int width,
int fore,int back,int hfore,int hback,
int shadow,int shadowcolor);
int show();
void move(int xpos,int ypos);
};
//INPUT
class Tstring {
protected:
char laststring[81];
char bar[81];
int xpos;
int x;
int y;
int length;
int ucase;
int escape;
int retrn;
int tab;
int uparrow;
int dnarrow;
int shown;
int barred;
int firstchar;
int infgd;
int inbgd;
public:
Tstring();
~Tstring();
void init(int xloc,int yloc,int len,int uppercase);
void show();
void input();
void get_input();
void get_form_input();
void get_form_mouse_input();
void reset();
void preset(char *);
void erase(int);
char *getstring();
int escapehit();
int returnhit();
int tabhit();
int uparrowhit();
int dnarrowhit();
int isshown();
int isbarred();
int hit();
void setincolors(int,int);
};
class Tnumeral:public Tstring {
protected:
int real;
int end;
public:
void init(int xloc,int yloc,int len,int int_or_float);
void show();
void get_input();
void get_form_input();
void get_form_mouse_input();
void input();
float getfloat();
int getint();
long getlong();
};
class Tdate:public Tstring {
protected:
int date_ok;
public:
void init(int xloc,int yloc);
void show();
void get_input();
void validate();
int verified();
char *getdatestring();
long getdate();
};
#ifdef __LARGE__
class Gstring:public Tstring {
protected:
int curpos;
int curson;
void showcurs();
void hidecurs();
public:
void init(int,int,int,int);
void show();
void input();
void get_input();
void get_form_input();
void reset();
int isshown();
void check_for_blink();
};
#endif
//TBUTTON
class Tbutton {
protected:
int xpos;
int ypos;
int width;
int pressed;
int hilite;
char button[81];
char shadow[81];
char id[41];
public:
Tbutton();
void init(int,int,char *,int);
~Tbutton();
void show(int);
int buttonpressed();
int hit();
void press(int);
int ispressed();
};
class Tcheckbox {
protected:
int xpos;
int ypos;
int fgd;
int bgd;
int checked;
public:
Tcheckbox();
void init(int,int,int,int);
~Tcheckbox();
void show();
void grabcursor();
int hit();
void check();
void uncheck();
int ischecked();
};
//VIDBIOS
void set_default_palette();
void blankcolor(int);
void fade1_3();
void fade3_1();
void fade1_4();
void fade4_1();
void fade1_5();
void fade5_1();
void fadein(int);
void fadeout(int);
void rgb(int,int,int,int);
void make_grayscale();
void screenbord(int);
void disable_blink();
void enable_blink();
void disable_refresh();
void enable_refresh();
//GROBJECT
#ifdef __LARGE__
class Point
{
protected:
int x,y,color;
viewporttype vref;
public:
Point();
void move(int ptx,int pty);
virtual void draw();
void create(int ptx,int pty,int c);
void restoreviewport();
void Setcolor(int c);
virtual void setloc(int ptx,int pty);
virtual void erase();
int Getcolor();
int Getx();
int Gety();
};
//************************************************************************
class Colorbutton:public Point
{
protected:
int color;
int width;
int height;
public:
void init(int,int,int,int,int);
void show(int);
int clicked();
int hit();
int getcolor();
};
//************************************************************************
class Closebutton:public Colorbutton
{
public:
void show();
};
//************************************************************************
class Icon:public Point
{
protected:
int state;
public:
void far *picture;
Icon();
~Icon();
void init(int,int,char*);
void show();
void choose();
int hit();
int clicked();
int ispressed();
};
//************************************************************************
class Gcheckbox:public Point
{
protected:
int checked;
char *desc;
int length;
public:
Gcheckbox();
~Gcheckbox();
void init(int,int,char *);
void show();
void check();
void uncheck();
int is_checked();
int hit();
};
//************************************************************************
class Gradio:public Gcheckbox
{
public:
void show();
void check();
void uncheck();
};
//************************************************************************
class Acticon:public Icon
{
protected:
void *picture[32];
int state;
int numpix;
public:
Acticon();
~Acticon();
void init(int,int,char*);
void show(int);
void choose();
int ispressed();
void animate(int);
void backforth(int);
};
//************************************************************************
class Button:public Point
{
protected:
int state,sizex,sizey;
char btntxt[40];
int file_text;
void far *picture;
void getpic(char*);
public:
Button();
~Button();
virtual void show();
virtual void press();
void init(int ptx,int pty,char* text,int);
int hit();
int pressed();
};
//************************************************************************
class Bitmap:public Point
{
protected:
int sizex,sizey;
int size;
void far *picture;
int shown;
int clickcount;
long last_tick;
public:
Bitmap();
~Bitmap();
void init(int,int);
void load(char *);
void save(char *);
void show_XOR();
void show_COPY();
void show_AND();
void show_OR();
void show_NOT();
int is_shown();
void hide();
void moveto(int,int);
int capture(int,int,int,int);
int hit();
int clicked();
int LBDCLK();
int LBSCLK();
int xsize();
int ysize();
int bitmapx();
int bitmapy();
void changexy(int,int);
};
//************************************************************************
class Panel:public Point
{
protected:
int w;
int h;
int in_or_out;
int thick_or_thin;
public:
Panel();
~Panel();
virtual void show();
void init(int,int,int,int,int,int);
};
//************************************************************************
class Bevel:public Point
{
private:
int w;
int h;
int thick_or_thin;
Panel outerbevel;
Panel innerbevel;
public:
void init(int,int,int,int,int);
virtual void show();
};
//************************************************************************
class OKbox:public Point
{
protected:
Button OKbutton;
Button ESCbutton;
Panel panel;
char text[90];
void *screen;
int OKorNOT;
public:
OKbox();
~OKbox();
void init(int,int,char*);
int show();
};
//************************************************************************
class Gwindow:public Point
{
protected:
Closebutton closebox;
int w,h;
int fgd,bgd;
int tfgd,tbgd;
int active;
char title[48];
void *beneath;
public:
Gwindow(int,int,int,int,int,int,int,int,char *);
~Gwindow();
void show();
void redraw();
void hide();
int closeboxhit();
int sizecornerhit();
int titlebarhit();
void resize();
void move();
int write_to_disk();
int read_from_disk();
};
//GMENU
typedef char gitemarray[80][10];
class Gmenu {
protected:
int on;
int x,y,w,h;
int num;
gitemarray gitems;
int menuchoice;
int oldbarx,oldbary;
void *ptr;
void *menubar;
public:
Gmenu();
~Gmenu();
void init(int xloc,int yloc,int numentries,gitemarray gitem);
int show();
void hide();
int isshown();
};
class Gmenubutton {
protected:
int on;
int x,y;
int offfgd,offbgd;
int onfgd,onbgd;
char id[20];
public:
Gmenubutton();
~Gmenubutton();
void init(int xloc,int yloc,int ffgd,int fbgd,
int nfgd,int nbgd,char txt[20]);
void show();
void press();
int hit();
};
//GPRINT
void gprintf(int xloc,int yloc,char *fmt,...);
void gprintc(int xloc, int yloc, char *fmt,...);
void gprintxy(int xloc,int yloc,char *fmt,...);
#endif
//MISC
void smover(int row,int startpos,int endpos,int fgd,int bgd,char *string);
void smovel(int row,int startpos,int endpos,int fgd,int bgd,char *string);
void smoveu(int col,int startpos,int endpos,int fgd,int bgd,char *string);
void smoved(int col,int startpos,int endpos,int fgd,int bgd,char *string);
//SOUNDQ
#define TimerTick 0x8
#define noisemax 8192
#define ON 1
#define OFF 0
#define C 523
#define CS 554
#define D 587
#define DS 622
#define E 659
#define F 698
#define FS 740
#define G 784
#define GS 831
#define A 880
#define AS 932
#define B 988
#define C1 1046
#define SN 32
#define EN 63
#define QN 125
#define HN 250
#define WN 500
#define ENT 20
#define QNT 41
#define HNT 83
#define BN 30000,5
#define SR 30000,32
#define ER 30000,63
#define QR 30000,125
#define HR 30000,250
#define WR 30000,500
#define NM 30000,1
class SoundQ{
protected:
float speed_factor;
public:
SoundQ();
~SoundQ();
void play(int,int);
void adjust_speed(float);
};
typedef struct
{
int duration;
int freq;
} noise;
void empty_sound_queue();
void init_sound(void);
void restore_sound(void);
int submit_sound(int freq,int delay);
void interrupt soundsystem(...);
//SCREEN
extern "C" void _Cdecl vga256_driver();
class Screen {
protected:
static int huge alwayszero();
public:
Screen();
~Screen();
int VGAH();
int VGAM();
int VGAL();
int VGA256();
void fill(int);
};